libx86: generate cpuid-autogen.h in the libx86 include dir
authorRoger Pau Monné <roger.pau@citrix.com>
Thu, 21 Jun 2018 14:35:46 +0000 (16:35 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 19 Jul 2018 18:31:31 +0000 (19:31 +0100)
This avoids all users needing to opencode local generation of the file.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
.gitignore
tools/include/Makefile
tools/libxc/Makefile
tools/libxc/xc_cpuid_x86.c
xen/include/Makefile
xen/include/asm-x86/cpufeatures.h
xen/include/xen/lib/x86/Makefile [new file with mode: 0644]
xen/include/xen/lib/x86/cpuid.h

index 5b8448d8f7530797172b93926d517e67dd492dcf..55b78008c03969d2b0a379e57eecc1f71867843a 100644 (file)
@@ -311,7 +311,6 @@ xen/arch/*/efi/runtime.c
 xen/include/headers*.chk
 xen/include/asm
 xen/include/asm-*/asm-offsets.h
-xen/include/asm-x86/cpuid-autogen.h
 xen/include/compat/*
 xen/include/config/
 xen/include/generated/
@@ -319,6 +318,7 @@ xen/include/public/public
 xen/include/xen/*.new
 xen/include/xen/acm_policy.h
 xen/include/xen/compile.h
+xen/include/xen/lib/x86/cpuid-autogen.h
 xen/test/livepatch/config.h
 xen/test/livepatch/xen_bye_world.livepatch
 xen/test/livepatch/xen_hello_world.livepatch
index 34ca1cb76057351319dcaafa3fd70cfb4e14d726..22df221daa74ebd342a573b77f7420a1f9f76e86 100644 (file)
@@ -23,8 +23,11 @@ xen/.dir:
        ln -sf $(XEN_ROOT)/xen/include/acpi acpi
 ifeq ($(CONFIG_X86),y)
        ln -sf $(XEN_ROOT)/xen/include/asm-x86 xen/asm
-       mkdir -p xen/lib
-       ln -sf $(XEN_ROOT)/xen/include/xen/lib/x86 xen/lib/x86
+       mkdir -p xen/lib/x86
+       for f in $(filter-out %autogen.h,$(patsubst $(XEN_ROOT)/xen/include/xen/lib/x86/%,%,Makefile $(wildcard $(XEN_ROOT)/xen/include/xen/lib/x86/*.h))); do \
+               ln -sf $(XEN_ROOT)/xen/include/xen/lib/x86/$$f xen/lib/x86/$$f; \
+       done
+       $(MAKE) -C xen/lib/x86 all XEN_ROOT=$(XEN_ROOT)
 endif
        touch $@
 
index 157553c0b31720a83585479a2a2ca633a528f7b2..ca2b20345e33bc27fb53fc7c9aa61b6741ce3d4e 100644 (file)
@@ -147,15 +147,6 @@ $(eval $(genpath-target))
 
 xc_private.h: _paths.h
 
-ifeq ($(CONFIG_X86),y)
-
-_xc_cpuid_autogen.h: $(XEN_ROOT)/xen/include/public/arch-x86/cpufeatureset.h $(XEN_ROOT)/xen/tools/gen-cpuid.py
-       $(PYTHON) $(XEN_ROOT)/xen/tools/gen-cpuid.py -i $^ -o $@.new
-       $(call move-if-changed,$@.new,$@)
-
-build: _xc_cpuid_autogen.h
-endif
-
 $(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \
 $(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): xc_private.h
 
index 165bbf86acd12d5a8b537643c3d7df889a7b3d88..6e02792a1560085e5a7a1956296c5bed31403e7d 100644 (file)
@@ -31,7 +31,6 @@ enum {
 #define XEN_CPUFEATURE(name, value) X86_FEATURE_##name = value,
 #include <xen/arch-x86/cpufeatureset.h>
 };
-#include "_xc_cpuid_autogen.h"
 
 #include <xen/lib/x86/cpuid.h>
 
index 7c5034e6e0ce7caf4af8c1078b71844f6a46d831..df041829653b15efad1aa949b81fbb02099bd79a 100644 (file)
@@ -141,14 +141,13 @@ headers++.chk: $(PUBLIC_HEADERS) Makefile
 endif
 
 ifeq ($(XEN_TARGET_ARCH),x86_64)
+.PHONY: lib-x86-all
+lib-x86-all:
+       $(MAKE) -C xen/lib/x86 all
 
-$(BASEDIR)/include/asm-x86/cpuid-autogen.h: $(BASEDIR)/include/public/arch-x86/cpufeatureset.h $(BASEDIR)/tools/gen-cpuid.py FORCE
-       $(PYTHON) $(BASEDIR)/tools/gen-cpuid.py -i $< -o $@.new
-       $(call move-if-changed,$@.new,$@)
-
-all: $(BASEDIR)/include/asm-x86/cpuid-autogen.h
+all: lib-x86-all
 endif
 
 clean::
        rm -rf compat config generated headers*.chk
-       rm -f $(BASEDIR)/include/asm-x86/cpuid-autogen.h
+       rm -f $(BASEDIR)/include/xen/lib/x86/cpuid-autogen.h
index 8e5cc53dde291e0d60fe30bbc4e1f7e06159900a..249fa6e5312f75aa299bde23bf217e7272e226ac 100644 (file)
@@ -2,7 +2,7 @@
  * Explicitly intended for multiple inclusion.
  */
 
-#include <asm/cpuid-autogen.h>
+#include <xen/lib/x86/cpuid-autogen.h>
 
 #define FSCAPINTS FEATURESET_NR_ENTRIES
 
diff --git a/xen/include/xen/lib/x86/Makefile b/xen/include/xen/lib/x86/Makefile
new file mode 100644 (file)
index 0000000..408d69c
--- /dev/null
@@ -0,0 +1,8 @@
+include $(XEN_ROOT)/Config.mk
+
+.PHONY: all
+all: cpuid-autogen.h
+
+cpuid-autogen.h: $(XEN_ROOT)/xen/include/public/arch-x86/cpufeatureset.h $(XEN_ROOT)/xen/tools/gen-cpuid.py
+       $(PYTHON) $(XEN_ROOT)/xen/tools/gen-cpuid.py -i $< -o $@.new
+       $(call move-if-changed,$@.new,$@)
index cedbec518d67aeaa2c7eda30e062a43df210b508..347f5dbdfd8598a99b1ccfda029becec4b0ff177 100644 (file)
@@ -2,6 +2,8 @@
 #ifndef XEN_LIB_X86_CPUID_H
 #define XEN_LIB_X86_CPUID_H
 
+#include <xen/lib/x86/cpuid-autogen.h>
+
 struct cpuid_leaf
 {
     uint32_t a, b, c, d;